home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / idioms.lha / idioms / ev3tria.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  1KB  |  29 lines

  1. /* Copyright (c) 1992 by AT&T Bell Laboratories. */
  2. /* Advanced C++ Programming Styles and Idioms */
  3. /* James O. Coplien */
  4. /* All rights reserved. */
  5.  
  6. //************************************************************//
  7. //                                                            //
  8. //     F I L E :    E V 3 T R I A . C                         //
  9. //                                                            //
  10. //         Code for version 3 of class Triangle               //
  11. //                                                            //
  12. //************************************************************//
  13.  
  14. #include "ev3tri.h"
  15.  
  16. Shape
  17. Triangle::make()
  18. {
  19.     printf("Triangle::make() entered\n");
  20.     Triangle *retval = new Triangle;;
  21.     retval->p1 = retval->p2 = retval->p3 = Coordinate(0,0);
  22.     retval->exemplarPointer = this;
  23.     color = Black;
  24.     return Shape(*retval);
  25. }
  26.  
  27. // this will get statically expanded for use by make above
  28. Triangle::Triangle() {  }  // size and vptr knowledge are in here
  29.